import Vue from 'vue'
import Vuex from 'vuex'

import mutations from './mutations'
import actions from './action'
import getters from './getters'

Vue.use(Vuex)

const state = {
    userInfo: null, //用户信息
    loginState: false, //是否登录
    count: 1,
    todos: [
        { id: 1, text: '...', done: false },
        { id: 2, text: '...', done: false },
        { id: 3, text: '...', done: true },
        { id: 4, text: '...', done: true },
    ],
    passValue: '',
    /* 
        其他的全局状态
    */
}

export default new Vuex.Store({
    state,
    mutations,
    actions,
    getters,
})